const express = require('express');
const router = express.Router();
const pgService = require('../service/pg');

//ping数据库
router.post('/ping', async(req, res) => {
    let {jdbcUrl} = req.body;
    if (!jdbcUrl) return res.json({success: false, msg: '缺少参数'});
    let data = await pgService.ping(jdbcUrl);
    return res.json(data);
})


//生成数据
router.post('/generate', async(req,res) => {
    // let {oid} = req.body;
    // if (!oid) return res.json({success:false, msg: '缺少参数'});
    // let data = await initUser(oid);
    // return res.json(data);

    let data = {success: 111}
    return res.json(data);
})


module.exports = router;